/* GUI CONVERTED from rwdprp.p (converter v1.76) Mon Sep 17 22:18:40 2001 */
/* rwdprp.p - DEPARTMENT REPORT                                         */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.6.1.5 $                                                     */
/*V8:ConvertMode=FullGUIReport                                          */
/* REVISION: 2.0      LAST MODIFIED: 03/25/87   BY: EMB */
/* REVISION: 4.0      LAST MODIFIED: 02/03/88   BY: RL  *A171**/
/* REVISION: 4.0      LAST MODIFIED: 02/24/88   BY: WUG *A175**/
/* REVISION: 6.0      LAST MODIFIED: 11/02/90   BY: emb *D175**/
/* REVISION: 6.0      LAST MODIFIED: 08/23/91   BY: pma *D806**/
/* REVISION: 7.0      LAST MODIFIED: 08/21/91   BY: pma *F003**/
/* REVISION: 8.6      LAST MODIFIED: 10/15/97   BY: bvm *K10X**/
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 10/01/99   BY: *N014* Jeff Wootton */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb              */
/* Old ECO marker removed, but no ECO header exists *F0PN*               */
/* Revision: 1.6.1.4     BY: Hualin Zhong   DATE: 05/04/01 ECO: *N0YC*   */
/* $Revision: 1.6.1.5 $    BY: Manjusha Inglay  DATE: 08/28/01  ECO: *P01R*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* DISPLAY TITLE          */

/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rwdprp_p_2 "Accounts !Bdn Usage"
/* MaxLen: Comment: */

&SCOPED-DEFINE rwdprp_p_3 "--------!Bdn Rate"
/* MaxLen: Comment: */

&SCOPED-DEFINE rwdprp_p_4 "---------!Lbr Usage"
/* MaxLen: Comment: */

&SCOPED-DEFINE rwdprp_p_5 "Labor Capacity"
/* MaxLen: Comment: */

&SCOPED-DEFINE rwdprp_p_6 "Variance!Lbr Rate"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define variable dept like dpt_dept.
define variable dept1 like dpt_dept.
define variable acct_label as character format "x(5)".

/* SELECT FORM */

/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
dept           colon 25
   dept1          label {t001.i}
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/* REPORT BLOCK */

{wbrp01.i}


/*GUI*/ {mfguirpa.i true "printer" 132 " " " " " "  }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:


   if dept1 = hi_char then dept1 = "".

   if c-application-mode <> 'web' then
      
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


   {wbrp06.i &command = update &fields = "  dept dept1" &frm = "a"}

   if (c-application-mode <> 'web') or
      (c-application-mode = 'web' and
      (c-web-request begins 'data')) then do:

      bcdparm = "".
      {mfquoter.i dept   }
      {mfquoter.i dept1  }

      if dept1 = "" then dept1 = hi_char.

   end.

   /* OUTPUT DESTINATION SELECTION */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i "printer" 132 " " " " " " " " }
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:



   {mfphead.i}

   for each dpt_mstr where dpt_dept >= dept and dpt_dept <= dept1
         no-lock with frame b width 132 no-attr-space:

      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


      /* SET EXTERNAL LABELS */
      setFrameLabels(frame b:handle).
      display
         dpt_dept
         dpt_desc
         space(4)
         dpt_lbr_cap  column-label {&rwdprp_p_5}
         space(4)
         getTermLabelRtColon("ACCOUNT",5) @ acct_label no-label
         dpt_cop_acct
         dpt_lbr_acct
         dpt_bdn_acct
         space(4)
         dpt_lvar_acc column-label {&rwdprp_p_4}
         dpt_lvrr_acc column-label {&rwdprp_p_6}
         dpt_bvar_acc column-label {&rwdprp_p_2}
         dpt_bvrr_acc column-label {&rwdprp_p_3} WITH STREAM-IO /*GUI*/ .

      down 1.

      display
         getTermLabelRtColon("SUB-ACCOUNT",5) @ acct_label no-label
         dpt_cop_sub  @ dpt_cop_acct
         dpt_lbr_sub  @ dpt_lbr_acct
         dpt_bdn_sub  @ dpt_bdn_acct
         dpt_lvar_sub @ dpt_lvar_acc
         dpt_lvrr_sub @ dpt_lvrr_acc
         dpt_bvar_sub @ dpt_bvar_acc
         dpt_bvrr_sub @ dpt_bvrr_acc WITH STREAM-IO /*GUI*/ .
      down 1.

      display
         getTermLabelRtColon("COST_CENTER",5) @ acct_label no-label
         dpt_cop_cc  @ dpt_cop_acct
         dpt_lbr_cc  @ dpt_lbr_acct
         dpt_bdn_cc  @ dpt_bdn_acct
         dpt_lvar_cc @ dpt_lvar_acc
         dpt_lvrr_cc @ dpt_lvrr_acc
         dpt_bvar_cc @ dpt_bvar_acc
         dpt_bvrr_cc @ dpt_bvrr_acc WITH STREAM-IO /*GUI*/ .

   end.

   /* REPORT TRAILER  */
   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


end.

{wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" dept dept1 "} /*Drive the Report*/
